home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1993 July / InfoMagic USENET CD-ROM July 1993.ISO / sources / misc / volume8 / rntomh < prev    next >
Encoding:
Text File  |  1989-08-23  |  2.7 KB  |  79 lines

  1. Newsgroups: comp.sources.misc
  2. subject: v08i012: rntomh: comp.sources.unix article
  3. From: allbery@uunet.UU.NET (Brandon S. Allbery - comp.sources.misc)
  4. Reply-To: jamesp@amadeus.wr.tek.com ("James T. Perkins")
  5.  
  6. Posting-number: Volume 8, Issue 12
  7. Submitted-by: jamesp@amadeus.wr.tek.com ("James T. Perkins")
  8. Archive-name: rntomh
  9.  
  10. [???  I use "s    |/usr/llib/mh/rcvstore +" myself -- if I wanted to, I could
  11. force the newsgroup, but I prefer manual handling so I can group sources
  12. by archive-name, etc.  ++bsa]
  13.  
  14. Have you ever had the desire to save your rn articles as MH-style
  15. messages in an MH mail folder? I found an answer on one of the source
  16. newsgroups some time back, and the following is a much faster
  17. implementation, which also does not have the nasty side effect of
  18. changing your current MH folder.
  19.  
  20. When running rn, to save the current article into the mail folder, just
  21. type "s" to save the message.
  22.  
  23. Add this line to your .rnmac file: "s    s|rntomh %C %a^J"
  24. Do not include the double quotes.  Yes, that's a TAB character after
  25. the intial "s", and yes, that is a literal "^" followed by a literal "J"
  26. at the end.
  27.  
  28. Add the following script into your local bin directory.  Make sure you
  29. make it executable and readable, and rehash if you are running csh or
  30. one of it's hoary relatives.
  31.  
  32. Enjoy!
  33.  
  34. -------------------------------- cut here -------------------------------------
  35. #! /bin/sh
  36. # This is a shell archive.  Remove anything before this line, then unpack
  37. # it by saving it into a file and typing "sh file".  To overwrite existing
  38. # files, type "sh file -c".  You can also feed this as standard input via
  39. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  40. # will see the following message at the end:
  41. #        "End of shell archive."
  42. # Contents:  rn2mh
  43. # Wrapped by allbery@uunet on Wed Aug 23 19:47:05 1989
  44. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  45. if test -f 'rn2mh' -a "${1}" != "-c" ; then 
  46.   echo shar: Will not clobber existing file \"'rn2mh'\"
  47. else
  48. echo shar: Extracting \"'rn2mh'\" \(280 characters\)
  49. sed "s/^X//" >'rn2mh' <<'END_OF_FILE'
  50. X: ----- start of script "rntomh" -----
  51. X#
  52. X# rntomh
  53. X#
  54. X# Arguments:
  55. X#   %C  newsgroup name, dot form
  56. X#   %a  article number
  57. X#
  58. X# Stdin:
  59. X#   the article to save
  60. X
  61. Xfolder=+news
  62. Xnew="`mhpath new $folder`"
  63. X( echo "Article: $2 of $1" ; cat ) > $new
  64. X
  65. Xecho Saved article $2 of $1 to $folder.
  66. END_OF_FILE
  67. if test 280 -ne `wc -c <'rn2mh'`; then
  68.     echo shar: \"'rn2mh'\" unpacked with wrong size!
  69. fi
  70. # end of 'rn2mh'
  71. fi
  72. echo shar: End of shell archive.
  73. exit 0
  74. --
  75.  ___    ___   ___
  76. |   \  / _ \ / __|  James T. Perkins, jamesp@dadla.la.tek.com, (503)629-1149
  77. | |> || |_| |\__ \  Tektronix, Dig Sys Div, DAS 9200 Software Integration
  78. |___/ |_| |_||___/  MS 92-725, PO Box 4600, Beaverton, OR 97075
  79.